/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package verins.beans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author hectdx
 */
@Entity
@Table(name = "padronelectoral", schema = "verinscribe")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Padronelectoral.findAll", query = "SELECT p FROM Padronelectoral p"),
    @NamedQuery(name = "Padronelectoral.findByIdpadronelectoral", query = "SELECT p FROM Padronelectoral p WHERE p.idpadronelectoral = :idpadronelectoral"),
    @NamedQuery(name = "Padronelectoral.findByIdprocesoelectoral", query = "SELECT p FROM Padronelectoral p WHERE p.idprocesoelectoral = ?1 and p.estado.idestadopadron = ?2")})
public class Padronelectoral implements Serializable {
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idpadronelectoral")
    private List<Actaprocesamiento> actaprocesamientoList;
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private int id;
    @Column(name = "idprocesoelectoral")
    private Integer idprocesoelectoral;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "padronelectoral")
    private List<Paginapadronelectoral> paginapadronelectoralList;
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idpadronelectoral", nullable = false, length = 50)
    private String idpadronelectoral;
    @JoinColumn(name = "idresponsable", referencedColumnName = "dni", nullable = false)
    @ManyToOne(optional = false)
    private Persona idresponsable;
    @JoinColumn(name = "idpartidopolitico", referencedColumnName = "idpartidopolitico", nullable = false)
    @ManyToOne(optional = false)
    private Partidopolitico idpartidopolitico;
    @JoinColumn(name = "idgrupo", referencedColumnName = "idgrupo", nullable = false)
    @ManyToOne(optional = false)
    private Grupo idgrupo;
    @JoinColumn(name = "estado", referencedColumnName = "idestadopadron")
    @ManyToOne
    private Estadopadron estado;

    public Padronelectoral() {
    }

    public Padronelectoral(String idpadronelectoral) {
        this.idpadronelectoral = idpadronelectoral;
    }

    public String getIdpadronelectoral() {
        return idpadronelectoral;
    }

    public void setIdpadronelectoral(String idpadronelectoral) {
        this.idpadronelectoral = idpadronelectoral;
    }

    public Persona getIdresponsable() {
        return idresponsable;
    }

    public void setIdresponsable(Persona idresponsable) {
        this.idresponsable = idresponsable;
    }

    public Partidopolitico getIdpartidopolitico() {
        return idpartidopolitico;
    }

    public void setIdpartidopolitico(Partidopolitico idpartidopolitico) {
        this.idpartidopolitico = idpartidopolitico;
    }

    public Grupo getIdgrupo() {
        return idgrupo;
    }

    public void setIdgrupo(Grupo idgrupo) {
        this.idgrupo = idgrupo;
    }

    public Estadopadron getEstado() {
        return estado;
    }

    public void setEstado(Estadopadron estado) {
        this.estado = estado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpadronelectoral != null ? idpadronelectoral.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Padronelectoral)) {
            return false;
        }
        Padronelectoral other = (Padronelectoral) object;
        if ((this.idpadronelectoral == null && other.idpadronelectoral != null) || (this.idpadronelectoral != null && !this.idpadronelectoral.equals(other.idpadronelectoral))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "verins.beans.Padronelectoral[ idpadronelectoral=" + idpadronelectoral + " ]";
    }

    @XmlTransient
    public List<Paginapadronelectoral> getPaginapadronelectoralList() {
        return paginapadronelectoralList;
    }

    public void setPaginapadronelectoralList(List<Paginapadronelectoral> paginapadronelectoralList) {
        this.paginapadronelectoralList = paginapadronelectoralList;
    }

    public Integer getIdprocesoelectoral() {
        return idprocesoelectoral;
    }

    public void setIdprocesoelectoral(Integer idprocesoelectoral) {
        this.idprocesoelectoral = idprocesoelectoral;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @XmlTransient
    public List<Actaprocesamiento> getActaprocesamientoList() {
        return actaprocesamientoList;
    }

    public void setActaprocesamientoList(List<Actaprocesamiento> actaprocesamientoList) {
        this.actaprocesamientoList = actaprocesamientoList;
    }
}
